#include "Arduino.h"
#include <Keypad.h>

const byte ROWS = 4;
const byte COLS = 4;

char hexaKeys[ROWS][COLS] = {
    {'1', '4', '7', '*'},
    {'2', '5', '8', '0'},
    {'3', '6', '9', '#'},
    {'A', 'B', 'C', 'D'}
};

byte rowPins[ROWS] = {D6, D5, D4, D3};
byte colPins[COLS] = {D10, D9, D8, D7};

Keypad keypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);

void setup() {
    Serial.begin(115200);
}

void loop() {
    char key = keypad.getKey();
    if (key != NO_KEY) {
        Serial.println(key);
    }
}